import Vue from 'vue';
// 导出Vue对象
export default new Vue({
    data () {
        return {
            person: {
                name: 'zhangsan',
                age: 18,
            },
        };
    },
    created () {
        this.$on('changeName', (newName) => {
            
            this.person.name = newName;
            console.log(this.person.name);
        });
        this.$on('changeAge', (newAge) => {
            this.person.age = newAge;
            console.log(this.person.age);
        });
    }
})